#pragma once

#include "ByteStream.h"
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>

class CPacket
{
public:
	friend class boost::serialization::access;
	CPacket(void);
	CPacket(IStream *bsPacketContent);

	template<class Archive> 
	void serialize(Archive & ar, const unsigned int version) 
	{
		ar & m_bsPacketContent;
	}

	std::string getBufferContent() const;
	void addBack(const std::string& data);
	void addFront(const std::string& data);
	void addAt(const std::string& data, int offset);
	void removeElements(int offset, int count);

	~CPacket(void);

public:
	IStream* m_bsPacketContent;
};